<template>
  <div class="main">
    <div class="top">
      <router-link to="/home"><img src="../../assets/logo.png" alt=""></router-link>
      <router-link to="/home">返回首页</router-link>
    </div>
    <div class="center">
      <div class="content">
        <p>天臣软件会员登录</p>
        <div class="form-warp fr">
          <div class="input-box">
            <input type="text" placeholder="用 户 名 / 手 机 号" id="UserName" v-model="username">
            <img src="../../assets/head.png" alt="">
          </div>
          <div class="input-box">
            <input type="password" placeholder="密 码" id="Password" v-model="password">
            <img src="../../assets/pass.png" alt="">
          </div>
          <div class="btn-box" @click="dl()">
            <a href="javascript:;" class="login-btn">登录</a>
          </div>
          <div class="forget clearboth">
            <a href="/login/findpassword" class="fr">忘记密码?</a>
            <a href="/login/register" class="fl register-a">注册成为会员&gt;&gt; </a>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'sign',
  data () {
    return {
      username: '',
      password: ''
    }
  },
  methods: {
    dl: function () {
      let that = this
      if (that.username != '' && that.password != '') {
        if (that.username == 'admin' && that.password == 'admin') {
          that.$store.commit('changeLogin', '5')
          that.$router.push({name: 'home'})
          localStorage.setItem('token', '12312')
        } else {
          that.$message({
            message: '账号或者密码错误',
            type: 'error'
          })
        }
      } else {
        that.$message({
          message: '请输入账号密码',
          type: 'error'
        })
      }
    }
  }
}
</script>

<style scoped lang="less">
.main{
  position: relative;
  width: 100%;
  height: 100%;
  .top{
    width: 100%;
    height: 70px;
    line-height: 70px;
    background-color: #fff;
    overflow: hidden;
    a{
      &:first-child{
        display: block;
        margin: 0 67px;
        font-size: 14px;
        color: #333333;
        float: left;
        img{
          padding-top: 15px;
          max-width: 100%;
        }
      }
      &:nth-child(2){
        display: block;
        margin: 0 67px;
        font-size: 14px;
        color: #333333;
        float: right;
      }
    }
  }
  .center{
    width: 100%;
    height: 787px;
    background: url("../../assets/bg.jpg") no-repeat center;
    background-size: 100% auto;
    .content{
      float: right;
      margin-right: 300px;
      margin-top: 170px;
      p{
        width: 480px;
        text-align: center;
        font-size: 30px;
        color: #4c77b2;
        font-weight: bold;
        margin-bottom: 40px;
      }
      .form-warp{
        width: 480px;
        margin: 0 auto;
        height: 350px;
        border: 3px solid #d2d2d2;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        -ms-box-sizing: border-box;
        box-sizing: border-box;
        background-color: #fff;
        border-radius: 8px;
        padding: 60px 45px 0;
        .input-box{
          position: relative;
          width: 100%;
          margin-bottom: 20px;
          input{
            width: 100%;
            height: 47px;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            -ms-box-sizing: border-box;
            box-sizing: border-box;
            border: 1px solid #d2d2d2;
            border-radius: 4px;
            padding: 12px 15px 12px 50px;
          }
          img{
            position: absolute;
            top: 12px;
            left: 15px;
          }
        }
        .btn-box{
          width: 100%;
          padding-top: 10px;
          a{
            display: inline-block;
            width: 100%;
            height: 45px;
            line-height: 45px;
            text-align: center;
            color: #fff;
            border-radius: 4px;
            font-size: 14px;
            background-color: #4c8cdc;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            -ms-box-sizing: border-box;
            box-sizing: border-box;
            -webkit-transition: all 0.3s;
            -moz-transition: all 0.3s;
            -ms-transition: all 0.3s;
            transition: all 0.3s;
            opacity: 1;
          }
        }
        .forget{
          padding: 6px 0 0;
          font-size: 14px;
          display: flex;
          justify-content: space-between;
        }
      }
    }
  }
}
</style>